<admintpl file="header" />
<!-- Bootstrap -->

<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet" />

</head>
<body>

    <div class="wrap">
        <ul class="nav nav-tabs">
           	<li><a href="{:U('SupervisionMeeting/index')}">监理会议纪要管理</a></li>
			<li class="active"><a href="{:U('SupervisionMeeting/adds')}">新增过往会议纪要</a></li>
        </ul>
        <section class="tab-pane active fade in" id="access">

            <div class="row">
                <div class="col-xs-12 col-md-12 col-lg-12">
                    <div class="panel panel-info">

                        <div class="panel-body">
                            <form class="form-horizontal form-inline tg" action="{:U('SupervisionMeeting/add_post')}" method="post" >
                                <div class="text-center">
                                    <h2>
                                        杭州市中医院丁桥分院工程 <br />
                                        <!--<small>监理例会纪要</small>-->
                                    </h2>

                                    <label>(第</label><input type="text" name="issue" class="input-xt input-num"  required /><label>期)</label>
                                    <hr />
                                </div>
                                <div class="row tg-header">
                                    <div class="col-md-12">
                                        <p class="tg-to">
                                            <label>会议时间:</label>
                                            <input type="text" name="meeting_time" class="js-date input-xt input-name" value="<php>echo date('Y-m-d')</php>" required />
                                        </p>
                                        <p class="pull-right tg-serialnum"><label>会议地点:</label><input class="input-xt input-department" name="meeting_place" required /></p>
                                    </div>
                                </div>
                                <div class="well report">


                                    <fieldset>
                                        <legend>会议纪要内容</legend>
                                       
                                                
                                                <textarea class="input input-light-border" name="this_week_problem" style="height: 400px"></textarea>                                   
                                    </fieldset>
                                                        
                                    <fieldset>
                                        <legend class='controls'>
                                        	附:会议签到表
                                            <a href="javascript:void(0);" class="btn upBtn btn-primary" name="attachment_1">上传</a>
                                        </legend>
                                        <legend class='controls' style="margin-left: 30px">
                                            其他
                                            <a class="btn upBtn btn-primary" name="attachment_2" href="javascript:void(0);" style="margin-left: 60px">上传</a>
                                        </legend>
                                        <input type="file" id="upFile" name="upFile" style="display:none" />
                                    </fieldset>

                                    <div class="signature">
                                        <p>
                                            浙江泛华工程监理有限公司
                                        </p>
                                        <p>
                                            杭州市中医院丁桥分院工程监理部整理
                                        </p>


                                    </div>
                                    <p class="signature-date">
                                        <input type="text" class="js-date input-xt" name="publish_time" value="<php>echo date('Y-m-d');</php>" required />
                                    </p>

                                </div>

                                <div class="form-actions">
                                    <button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
                                    <a class="btn btn-default" href="javascript:history.back(-1);">{:L('BACK')}</a>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>

            </div>

        </section>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script type="text/javascript">
        $(document).ready(function(e) {
            window.obj = '';
            // 选择图片
            $(document).on("click", ".upBtn", function(e) {
                if($(this).attr("name") == "attachment_2"){
                    $("#upFile").replaceWith('<input type="file" id="upFile" name="upFile" style="display:none" />');
                    $("#upFile").on("change", function(){
                        UploadFile("{:U('SupervisionMeeting/upload')}", "supervision_meeting");
                    });
                } else {
                    $("#upFile").replaceWith('<input type="file" id="upFile" name="upFile" style="display:none" />');
                    $("#upFile").on("change", function(){
                        UploadOneFile("{:U('SupervisionMeeting/upload')}", "supervision_meeting");
                    });
                }
                window.obj = $(this);
                $("#upFile").click();
            });         
            $(document).on("click", ".delFile", function(){
                if($(this).attr("value") != undefined){
                    delFile("{:U('SupervisionPlan/delFile')}", $(this).attr("value"), $(this))
                } else {
                    $(this).closest("div").remove();
                }
            });
            // 拼接一行
            $(".addLine").click(function(){
                var html =  "<tr>" +
                            "   <td><input type=\"text\" name=\"job_name[]\" /></td>" +
                            "   <td><input type=\"text\" name=\"this_week_count[]\" /></td>" +
                            "   <td><input type=\"text\" name=\"next_week_count[]\" /></td>" +
                            "   <td>" +
                            "       <input type=\"hidden\" name=\"plan_type[]\" value=\""+$(this).attr("type")+"\" >" +
                            "       <a class=\"btn delLine\" href=\"javascript:void(0);\">删除</a>" +
                            "   </td>" +
                            "</tr>";
                $(this).closest("thead").next().append(html);
            });
            // 删除一行
            $(document).on("click", ".delLine", function(){
                $(this).closest("tr").remove();
            });
        });
	</script>
</body>
</html>